#ifndef _SUMA_TYPES_H_
#define _SUMA_TYPES_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <pj/types.h> 
#include <pjmedia/codec.h> 


/**
 * give a lists all supported audio format, 
 * Users can select by configuring the parameters of 
 * the response during initialization of this module.
 * Bitmap table.
*/
typedef enum 
{
    OD_SIP_AUD_G711A_8K    = 1,   /*GJB1.0*/
    OD_SIP_AUD_G711A_16K   = 2,   /*GJB1.0*/
    OD_SIP_AUD_G711U       = 4,   /*GJB1.0*/   
    OD_SIP_AUD_G729A       = 8,   /*GB28181/GJB1.0*/
    OD_SIP_AUD_AAC         = 16,  /*GJB1.0*/
    OD_SIP_AUD_G723        = 32,  /*GB28181*/
    OD_SIP_AUD_G722        = 64,  /*GB28181*/
    OD_SIP_AUD_NUM
}od_sip_audio_media_type;

typedef enum 
{
    OD_SIP_VID_H264   = 1,   /*GB28181/GJB1.0*/
    OD_SIP_VID_H265   = 2,   /*GJB1.0*/
    OD_SIP_VID_JAVS   = 4,   /*GJB1.0*/
    OD_SIP_VID_MPEG4  = 8,   /*GB28181*/
    OD_SIP_VID_SVAC   = 16,  /*GB28181*/
    OD_SIP_VID_3GP    = 32   /*GB28181*/
}od_sip_video_media_type;


typedef enum 
{
    OD_SIP_NET_IPV4,
    OD_SIP_NET_IPV6
}od_sip_net_type;

typedef enum
{
    OD_REMOTE_OFFER,
    OD_LOCAL_OFFER,
}od_sip_session_type;


/*GB28181 SDP 'f='字段视频编码格式定义*/
typedef enum 
{
    OD_GB28181_CODEC_VID_MPEG4 = 1,
    OD_GB28181_CODEC_VID_H264,
    OD_GB28181_CODEC_VID_SVAC,
    OD_GB28181_CODEC_VID_3GP,
    OD_GB28181_CODEC_VID_NUM
}od_sip_gb28181_vid_codec;

/*GB28181 SDP 'f='字段分辨率定义*/
typedef enum
{
    OD_GB28181_RESO_QCIF = 1,
    OD_GB28181_RESO_CIF,
    OD_GB28181_RESO_4CIF,
    OD_GB28181_RESO_D1,
    OD_GB28181_RESO_720P,
    OD_GB28181_RESO_1080P_I,
    OD_GB28181_RESO_NUM
}od_sip_gb28181_reso;

/*GB28181 SDP 'f='字段码率类型定义*/
typedef enum
{
    OD_GB28181_BITRATE_CBR = 1,
    OD_GB28181_BITRATE_VBR,
    OD_GB28181_BITRATE_NUM
}od_sip_gb28181_bitrate_type;

/*GB28181 SDP 'f='字段音频编码格式定义*/
typedef enum
{
    OD_GB28181_CODEC_AUD_G711 = 1,
    OD_GB28181_CODEC_AUD_G723_1,
    OD_GB28181_CODEC_AUD_G729,
    OD_GB28181_CODEC_AUD_G722_1,
    OD_GB28181_CODEC_AUD_NUM
}od_sip_gb28181_aud_codec;

/*GB28181 SDP 'f='音频编码码率定义*/
typedef enum
{
    OD_GB28181_AUD_BR_5_3K = 1,
    OD_GB28181_AUD_BR_6_3K,
    OD_GB28181_AUD_BR_8K,
    OD_GB28181_AUD_BR_16K,
    OD_GB28181_AUD_BR_24K,
    OD_GB28181_AUD_BR_32K,
    OD_GB28181_AUD_BR_48K,
    OD_GB28181_AUD_BR_64K,
    OD_GB28181_AUD_BR_NUM
}od_sip_gb28181_aud_bitrate;

/*GB28181 SDP 'f='音频采样率定义*/
typedef enum
{
    OD_GB28181_AUD_SAMPLERATE_8K = 1,
    OD_GB28181_AUD_SAMPLERATE_14K,
    OD_GB28181_AUD_SAMPLERATE_16K,
    OD_GB28181_AUD_SAMPLERATE_32K,
    OD_GB28181_AUD_SAMPLERATE_NUM,
}od_sip_gb28181_aud_samplerate;


typedef struct
{
    pj_uint32_t media_type;         /**< audio or video from #od_sip_audio_media_type defines*/
    pjmedia_codec_info codec_desc;  
    pjmedia_codec_fmtp codec_fmtp;
}od_sip_audio_desc;


/* Declaration of h264 level info */
typedef struct
{
    char   *profile_level_id;  /**< Level id*/
    unsigned max_mbps;         /**< Max macroblocks per second.*/
    unsigned max_fs;           /**< Max bitrate (kbps)*/

    /** resoluation match max_mbps & max_fs form V1.0*/
    struct
    {
        unsigned w;
        unsigned h;
    } reso;

    unsigned fps;         /**< referance frame rate*/
}od_h264_level_info_t;


/* Declaration of h265 level info */
typedef struct
{
    char  *profile_level_id;  /**< Level id*/
    unsigned max_lsr;         /**< Max luma sample rate*/
    unsigned max_lps;         /**< Max luma picture size*/

    /** resoluation match max_mbps & max_fs form V1.0*/
    struct
    {
        unsigned w;
        unsigned h;
    } reso;

    unsigned fps;         /**< referance frame rate*/
}od_h265_level_info_t;


extern const od_sip_audio_desc g_audio_desc[3];

extern const pj_str_t STR_IN;
extern const pj_str_t STR_IP4;
extern const pj_str_t STR_IP6;
extern const pj_str_t STR_RTP_AVP;
extern const pj_str_t STR_SDP_NAME;
extern const pj_str_t STR_SENDRECV;
extern const pj_str_t STR_SENDONLY;
extern const pj_str_t STR_RECVONLY;
extern const pj_str_t STR_INACTIVE;
extern const pj_str_t STR_AUDIO;
extern const pj_str_t STR_VIDEO;
extern const pj_str_t STR_PROFILE_LEVEL_ID;
extern const pj_str_t STR_MAX_MBPS;
extern const pj_str_t STR_MAX_FS;
extern const pj_str_t STR_MAX_LSR;
extern const pj_str_t STR_MAX_LPS;
extern const pj_str_t STR_MAX_CPB;
extern const pj_str_t STR_MAX_DPB;
extern const pj_str_t STR_MAX_BR;
extern const pj_str_t STR_PACKETIZATION_MODE;
extern const pj_str_t STR_SPROP_PARAMETER_SETS;
extern const pj_str_t STR_RTP_PORTMUX;
extern const pj_str_t STR_MUXID;
extern const pj_str_t STR_BANDW_TIAS;
extern const pj_str_t STR_BANDW_AS;
extern const pj_str_t STR_RTPMAP;
extern const pj_str_t STR_FMTP;
extern const pj_str_t STR_BITRATE;


extern const od_h264_level_info_t h264_standard_table[14];
extern const od_h265_level_info_t h265_standard_table[15];


#ifdef __cplusplus
}
#endif

#endif

/*_*/


